{% extends '::base.html.twig' %}

{% block stylesheets %}
{{ parent() }}
<link href="{{ asset('/plugins/fancybox/jquery.fancybox-1.3.1.css') }}" media="screen, projection" rel="stylesheet" type="text/css" />
{% endblock %}

{% block javascripts %}
{{ parent() }}
<script src="{{ asset('/plugins/fancybox/jquery.fancybox-1.3.1.pack.js') }}" type="text/javascript"></script>
{% endblock %}

{% block title %}Gallery{% endblock %}

{% block topbar %}
<div id="topbar">
    <strong class="wrapper">
        Gallery
    </strong>
</div>
{% endblock %}

{% block bodyclass %} class="fullwidth"{% endblock %}

{% block body %}
<div class="wrapper">
    <div id="content">
        <div class="entry">
            <h2>Gallery</h2>
            <div class="spacer"></div>

            {% for entity in entities %}
                {% if entity.getWebPath() %}
                <div class="one-half portfolio-item{% if ((loop.index-1) % 2) == 1 %} last{% endif %}">
                        <a href="{{ entity.getWebPath() }}" rel='lightbox[featured]' >
                            <img class="rounded" src="{{ entity.getWebPath() }}" alt='{{ entity.title }}' width='445' height='199' />
                        </a>
                </div>
                {% endif %}
                {% if ((loop.index-1) % 2) == 1 %}<div class="big-spacer"></div>{% endif %}
            {% endfor %}

            <div class="divider"></div>
        </div>
        <!-- END .entry -->

        {% if lastPageNumber > 1 %}
        <div class="paginator">
            <div class="pagingContainer">
                {% if page > 1 %}
                    <a href="{{ path('gallery') }}" class="first">First</a>
                    <a href="{{ path('gallery', {'page' : page - 1}) }}">« Prev</a>
                {% endif %}
                <div>
                    {% for numberOfPage in 1..lastPageNumber %}
                        <a href="{{ path('gallery', {'page' : numberOfPage}) }}" class="
                        {% if (numberOfPage == lastPageNumber) and (numberOfPage == page) %}
                        last
                        {% elseif (numberOfPage == 1) and (numberOfPage == page) %}first{% endif %}
                        {% if numberOfPage == page %}
                         active{% endif%}">{{ numberOfPage }}</a>
                        
                    {% endfor %}
                </div>
                {% if page < lastPageNumber %}
                    <a href="{{ path('gallery', {'page' : page + 1}) }}">Next »</a>
                    <a href="{{ path('gallery', {'page' : lastPageNumber}) }}" class="last">Last</a>
                {% endif %}
            </div>
        </div>
        {% endif %}
        <!-- END .paginator -->
    </div>
    <!-- END #content -->      
</div>
<!-- END .wrapper -->
{% endblock %}

{#% block bottombar %}
<span class="info"></span>
<a href="{{ path('home_page') }}">Home</a>
<span> » </span>
<a href="{{ path('goo_show') }}">GOO</a>
<span> » </span>
<a href="{{ path('call') }}" class="active">Funding Agencies</a>
{% endblock %#}

